import parent from '@/public/parent.js'
import rules from '@/public/rules.js'

export default {
  name: 'access',
  mixins: [parent, rules],
  data() {
    return {
      form: {
        cloudPlatformValue: '',
        resourceTypeValue: [],
        authorityTypeValue: '',
      },
      resourceType: [{
        label: '虚拟机',
        value: '虚拟机'
      }, {
        label: '内存',
        value: '内存'
      }, {
        label: '网络',
        value: '网络'
      }, {
        label: '存储',
        value: '存储'
      }],
      authorityType: [{
        label: '复制权',
        value: '复制权'
      }, {
        label: '使用权',
        value: '使用权'
      }, {
        label: '交易权',
        value: '交易权'
      }],
      cloudPlatform: [{
        label: '阿里云-华东',
        value: '阿里云-华东'
      }, {
        label: '阿里云-华中',
        value: '阿里云-华中'
      }, {
        label: '腾讯云-上海',
        value: '腾讯云-上海'
      }],
      tableData: [
        {
          cloudPlatformValue: '阿里云-华东',
          resourceTypeValue: ['内存', '网络'],
          authorityTypeValue: '使用权'
        },
        {
          cloudPlatformValue: '华为云-华中',
          resourceTypeValue: ['CPU', '网络'],
          authorityTypeValue: '交易权'
        },
        {
          cloudPlatformValue: '腾讯云-华中',
          resourceTypeValue: ['内存', '网络'],
          authorityTypeValue: '使用权'
        }
      ]
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    addButton() {
      let f = JSON.parse(JSON.stringify(this.form));
      this.tableData.push(f)
    }
  },
}
